<template>
  <t-color-picker ref="colorPicker" :color="color" @confirm="confirm"></t-color-picker>
</template>

<script lang="ts" setup>
import {ref, defineExpose} from 'vue';
import {useThemeStore} from "@/store/theme";

const colorPicker = ref(null)
const themeStore = useThemeStore()
const color = ref({
  r: 255,
  g: 102,
  b: 51,
  a: 1
})

const confirm = (e) => {
  console.log(e)
  themeStore.setCookColor(e)
}

const open = () => {
  colorPicker.value.open()
}

defineExpose({
  open
})
</script>

<style scoped lang="scss">

</style>